#! /usr/bin/perl -w
#
# (C) 2007 - Wenzel P. P. Peppmeyer
# Released under Artistic License
# see http://code.google.com/p/font4canvas/
#

use Getopt::Long;
my $font_name;
$result = GetOptions("name=s" => \$font_name);

print<<EOH;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://web.resource.org/cc/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="744.09448819"
   height="1052.3622047"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.45.1"
   sodipodi:docbase="/home/dex/public_html/canvas-fonts"
   sodipodi:docname="FreeSerif.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">
  <defs
     id="defs4" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     gridtolerance="10000"
     guidetolerance="10"
     objecttolerance="10"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="27.477416"
     inkscape:cx="112.51896"
     inkscape:cy="112.62871"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     inkscape:window-width="1592"
     inkscape:window-height="1116"
     inkscape:window-x="0"
     inkscape:window-y="0" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
EOH


@chars = split("", q{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890<>|,;.:-_#+*~!"$%&/()=\?'`[]} . '{}');
@chars = (0x21..0x7e,0xa1..0xff);
 
for my $c (@chars){
#my $v = ord($c);
$v = $c;

#$c =~ s/&/&amp;/g;
#$c =~ s/</&lt;/g;
#$c =~ s/>/&gt;/g;

print STDERR "&#$c";

print<<EOH;
    <text
       xml:space="preserve"
       style="font-size:12px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:FreeSerif"
      id="char$v"
      sodipodi:linespacing="125%"><textPath
         xlink:href="#path2409"
         id="textPath2414"><tspan
   id="tspan2372">&#$c;</tspan></textPath></text>
EOH
}

print<<EOH;
    <path
       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="M 97.134315,940.77964 L 126.79504,940.77964"
       id="path2409" />
  </g>
</svg>
EOH
